A standard modem can be in either one of two modes, command mode or data mode. In a command mode, no data is passed across the modem. The modem operation is controlled using standard modem “AT” or other commands. When the modem is connection to another modem, it goes into data mode. Changing back to command mode can be done with an escape sequence.
As for any standard modem, the following guidelines are used when issuing commands:                When using “AT” commands, start every command line (except the “A/” and “+++” commands) with an attention (“AT”) code characters. Otherwise, the modem will not execute the command.        The commands following the “AT” prefix can be uppercase, lowercase, or a combination of both.        Always type the “AT” prefix in the same case (not “At” or “aT”).        Telephone numbers may be entered with or without punctuation.        Commands must be terminated with a carriage-return character. This is typically ASCII 13 (0×0D). However, it can be changed by modifying the modem S-Register number 3.        
Each command line to a modem has the following format (with the exception of the “A/” and “+++” commands):                <AT><Command>{Argument}{=n}{ }        
Wherein “<AT>” is the attention code, “<Command>” is a command consisting of one letter of an ampersand (“&”), percent (“%”), or backslash (“\”) followed by a letter, “{Argument}” is optional information specific to the Command, and “{=n}” is used in some instance to qualify an Argument specific to the Command. The information in angle brackets (“<>”) must be included as part of the command line, while information in curly braces (“{}”) may or may not be necessary as part of the command line. It is also possible to string commands together in one command line. The attention code “AT” is only required at the beginning of the command line.
In the command mode, characters received from the serial port are interpreted as commands and must follow the guidelines described above. The modem transitions from the command mode to the data mode after a successful “ATD” command or after receiving a call in auto-answer mode. To transition from the data mode to the command mode, an escape, either a sequence of characters or toggling the DTR line, must be sent to the modem. This sequence is typically “+++”, however, this can be changed to another repeated character by modifying the modem S-Register number 2. Typically, a delay with no data transfer of one second before and after this escape sequence is required. This time delay can be changed by modifying the modem S-Register number 12. The “ATO” command is used to resume the data mode without having to hang-up and redial.
A separate TCP socket application is usually added to establish Internet connection once the modem is in data mode. However, it is often desirable that a TCP streaming socket can be opened on the modem so that an Internet client can directly communicate with an Internet server over the socket.